<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title>用户新增</title>
    <link rel="stylesheet" href="/plugins/layui/css/layui.css" media="all">
    <script src="/plugins/layui/layui.js"></script>
    <script src="/plugins/jquery/jquery.min.js?v=1.12.4"></script>
    <script src="/common/js/common.js"></script>
    <script src="/common/js/my-jquery.js?v=1.12.4"></script>
</head>
<body>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>用户>增加</legend>
</fieldset>

<form class="layui-form" action="" style="margin-top: 20px;" id="form">
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">名称</label>
            <div class="layui-input-inline">
                <input type="login" name="name" lay-verify="required" autocomplete="off" class="layui-input"
                       placeholder="名称" value="">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">登录名称</label>
            <div class="layui-input-inline">
                <input type="text" name="username" lay-verify="required" autocomplete="off" class="layui-input"
                       placeholder="登录名称" value="">
            </div>
        </div>
    </div>
    <!-- 修改页面，不显示该字段 -->
    <div class="layui-form-item">

        <div class="layui-inline">
            <label class="layui-form-label">密码</label>
            <div class="layui-input-inline">
                <input type="password" name="password" lay-verify="required" autocomplete="off" class="layui-input"
                       placeholder="密码" value="">
            </div>
        </div>
    </div>
<div class="layui-form-item" style="position:absolute;left:20px;bottom:0px;">
    <button class="layui-btn layui-btn-danger" type="button" lay-submit lay-filter="form" id="submit">保存</button>
    <button class="layui-btn layui-btn-normal" type="button" id="cancel">取消</button>
</div>
</form>
<script>
    layui.use(['form'], function () {
        var url = '/user/add.json';
        $(function(){
            Common.addOrUpdateData(url, "#form", "#submit");
            $("#cancel").click(function () {
                Common.closeFrame();
            })
        })

    })
</script>
</body>
</html>
